// Author: wsfuyibing <682805@qq.com>
// Date: 2025-05-01

package guest

import (
	"gitee.com/go-wares/framework-iris/framework/src/logics"
	"github.com/kataras/iris/v12"
	"server/app/http/logics/guest/map/address/location"
	"server/app/http/logics/guest/register"
	"server/app/http/logics/guest/setting"
	"server/app/http/logics/guest/weixin/fetch/mobile"
	"server/app/http/logics/guest/weixin/login"
)

// Controller
// 游客接口.
type Controller struct {
}

// GetMapAddress
// 基于经纬度获取地址信息.
func (o *Controller) GetMapAddress(i iris.Context) {
	logics.Do(i, location.New)
}

// GetSetting
// 读取设置.
func (o *Controller) GetSetting(i iris.Context) {
	logics.Do(i, setting.New)
}

// PostSendCaptcha
// 发送验证码.
func (o *Controller) PostSendCaptcha(i iris.Context) {
}

// PostRegister
// 注册账号.
func (o *Controller) PostRegister(i iris.Context) {
	logics.Do(i, register.New)
}

// PostWeixinLogin
// 微信登录.
//
// 使用小程序中获取到的 code 码到服务端获取 openid.
func (o *Controller) PostWeixinLogin(i iris.Context) {
	logics.Do(i, login.New)
}

// PostWeixinFetchMobile
// 获取手机号码.
//
// 使用小程序中获取到的 code 码到服务端获取 手机号码.
func (o *Controller) PostWeixinFetchMobile(i iris.Context) {
	logics.Do(i, mobile.New)
}
